# Maintainer: Sashanoraa <sasha@noraa.gay>
pkgname=stargazer-gmi
pkgver=1.0.2
pkgrel=0
pkgdesc="A fast and easy to use Gemini server"
url="https://sr.ht/~zethra/stargazer/"
arch="all !s390x !riscv64 !ppc64le" # cargo & ring
license="AGPL-3.0-or-later"
makedepends="cargo scdoc"
checkdepends="python3 py3-cryptography"
subpackages="
	$pkgname-doc
	$pkgname-openrc
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~zethra/stargazer/archive/$pkgver.tar.gz"
builddir="$srcdir/stargazer-$pkgver"
[ "$CARCH" = "armhf" ] && options="$options !check" # failing ci tests

build() {
	./scripts/build
}

check() {
	CARGO_ARGS='--release' ./scripts/test --skip IPv6Address,SCGIVars
}

package() {
	./scripts/install --prefix="$pkgdir/usr" \
		--sysconfdir="$pkgdir/etc" \
		--bashdir="$pkgdir/usr/share/bash-completion/completions" \
		--zshdir="$pkgdir/usr/share/zsh/site-functions" \
		--fishdir="$pkgdir/usr/share/fish/completions"
	install -Dm644 ./contrib/init/stargazer.initd "$pkgdir/etc/init.d/stargazer"
}

sha512sums="
244155c68689a178e7446c7cd34f804091ea24d5914a8e4f4f6c6224b1374618bc2138d20bc4ae2cc3f798205c1d9400376d16d431391bcafe04670ed6ae32ab  stargazer-gmi-1.0.2.tar.gz
"
